import http from '@/util/request'
export const Login = (params) => {
	return http.post('/user/login', params)
}
export const UpadateAdmin = (params) => {
	return http.put('/user/update/your', params)
}
// 会议室使用导出请求路径 /conferenceRoom/excel
export const ExportRoom = () => {
	return http.get(`/conference/excel`, {responseType: 'blob'})
}
//会议室列表用户预约信息请求
export const getConferenceInfo = (params) => {
	return http.post(`/conference/pgeListByUser`, params)
}
export const FetchConferences = (params) => {
	return http.post('/conference/pageList', params)
}
export const UpdateApprovalStatus = (params) => {
	return http.post('/conference/updateApprovalStatus', params)
}
//查询可预约会议时间
export const QueryTime = (params) => {
	return http.post(`/conference/getIdleTimePeriod`, params)
}
export const AddConference = (params) => {
	return http.post('/conference/addConference', params)
}
export const getConferenceById = (id) => {
	return http.get(`/conference/getById?id=${id}`)
}


export const Paginationuery = (params) => {
	return http.post('/conferenceRoom/pageList', params)
}
export const UpdateRoom = (params) => {
	return http.post('/conferenceRoom/updateRoom', params)
}
// 新增删除会议室的函数
export const DeleteRoom = (id) => {
	return http.post(`/conferenceRoom/delRoom?id=${id}`)
}


export const FetchUsers = (params) => {
	return http.get('/user/page', {params})
}

export const RegisterUser = (params) => {
	return http.post('/user/register', params)
}
export const UpdateUserPassword = (params) => {
	return http.put(`/user/updatePassword`, params)
}

export const ExportUsers = () => {
	return http.get('/user/export', {responseType: 'blob'})
}

export const ResetUserPassword = (params) => {
	return http.put('/user/reset', params)
}

export const UpdateUserInfo = (params) => {
	return http.put('/user/update', params)
}
export const UpdateMeInfo = (params) => {
	return http.put('/user/update/me', params)
}
export const RemoveUser = (ids) => {
	return http.delete('/user/remove', {data: ids})
}

export const AddRoom = (params) => {
	return http.post('/conferenceRoom/addRoom', params)
}
// 查询所有会议室
export const GetAllRoom = () => {
	return http.get(`/conferenceRoom/getAllRoom`)
}
export const QueryRoom = (school) => {
	return http.get(`/conferenceRoom/getList?campus=${school}`)
}

export const QueryScory = (id) => {
	return http.get(`/conferenceRoomFeedback/getFeedback?id=${id}`)
}
export const afterConferenceRegister = (parms) => {
	return http.post(`/conferenceRoomFeedback/afterConferenceRegister`, parms)
}
export const getAttendeeInfo = (conferenceId) => {
	return http.get(`/attendeeInfo/getAttendeeInfo?conferenceId=${conferenceId}`)
}

// 获取所有校区
export const getAllCampus = () => {
	return http.get('/campus/getAllCampus')
}
// 添加校区
export const addCampus = (params) => {
	return http.post('/campus/addCampus', params)
}
// 删除校区
export const delCampus = (id) => {
	return http.delete(`/campus/delCampus?id=${id}`)
}
// 修改校区
export const editCampus = (params) => {
	return http.put('/campus/editCampus', params)
}
// 获取会议室使用率
export const GetUsageRate = (campus) => {
	return http.get(`/conferenceRoom/getUsageRate?campus=${campus}`)
}

// 获取会议室使用率
export const GetConferenceStatistics = (campus) => {
	return http.get(`/conference/getConferenceStatistics?campus=${campus}`)
}
export const GetConferenceByMonth = (campus, month) => {
	return http.get(`/conference/getConferenceByMonth?campus=${campus}&month=${month}`)
}
export const GetConferenceInToday = (campus, month) => {
	return http.get(`/conference/getConferenceInToday?campus=${campus}`)
}
export const UpdateAnnouncements = (params) => {
	return http.put(`/announcement/update`, params)
}
export const AddAnnouncements = (params) => {
	return http.post(`/announcement/add`, params)
}
export const PageAnnouncements = (params) => {
	return http.post(`/announcement/page`, params)
}
export const GetAnnouncementById = (id) => {
	return http.get(`/announcement/getById?id=${id}`)
}
export const DownloadFile = (id) => {
	return http.get(`/attachment/downloadFile?id=${id}`, {
		responseType: 'blob'
	})
}
export const DeleteAnnouncementById = (id) => {
	return http.delete(`/announcement/deleteById?id=${id}`)
}


export const GetSummary = (id) => {
	return http.get(`/conferenceSummary/getSummary?id=${id}`)
}
export const UpdateSummary = (params) => {
	return http.put(`/conferenceSummary/update`, params)
}
export const AddSummary = (params) => {
	return http.post(`/conferenceSummary/add`, params)
}
export const PageSummary = (params) => {
	return http.post(`/conferenceSummary/pageList`, params)
}
export const GetDepartmentList = () => {
	return http.get(`/department/getDepartmentList`)
}
export const GetDepartmentTree = () => {
	return http.get(`/department/getDepartmentTree`)
}
export const GetDepartmentAndUsers = () => {
	return http.get(`/department/getDepartmentAndUsers`)
}

export const AddDepartment = (params) => {
	return http.post(`/department/addDepartment`,params)
}
export const UpdateDepartment = (params) => {
	return http.put(`/department/updateDepartment`,params)
}
export const DeleteDepartment = (id) => {
	return http.delete(`/department/deleteDepartment?id=${id}`)
}

